#pragma once

#include "Controller.h"
#include "TurnController.h"

#include "../domain/models/Card.h"
#include "../domain/models/CardSet.h"
#include "../domain/models/CardsCollection.h"
#include "../domain/models/Player.h"
#include "../views/abstract/IGameplayView.h"

namespace Controllers {
	class GameplayController: public Controller
	{
	private:
		Views::IGameplayView* view;
		TurnController* turn_controller;

		Players::PlayersQueue players;
		Players::Player* current_player;
		Cards::CardSet searched_cards;
		Cards::CardsCollection cards;
		Players::Player* winner;

		void makeTurn();

		void onGameWin();

	public:
		GameplayController();

		Players::Player* getCurrentPlayer();
		Players::PlayersQueue getPlayers();
		Cards::PlayersCards getPlayersCards();
		Cards::RoomsCards getRoomsCards();

		void startGame();
		void pickPlayers();
		void startRound();
		void endRound();

		bool isGameEnded();

	};

}

